Skip to content

Keep the own-account read policies' released description (self-host update rollback) - #533

Merged
nambok merged 1 commit into
mainfrom
fix/own-account-read-policy-replacement
Nov 9, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/own-account-read-policy-replacement

Conversation

@nambok

@nambok nambok commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updating a self-hosted install from v0.8.56-beta.20261109 to v0.8.57-beta.20261109 rolled back. The Api stack's GatewayOwnAccountRead failed with "A policy called coderhelm-prod-GatewayOwnAccountRead-aa934871 already exists. Duplicate names are not allowed", and McpProxy was cancelled with it.

#526 changed the Description of the managed policy grantOwnAccountRead creates (infra/lib/own-account-read.ts) to add "Bedrock knowledge bases". Description forces CloudFormation to replace an AWS::IAM::ManagedPolicy. The replacement keeps the generated name, and the create runs before the delete, so IAM refuses it. The same change hit WorkerOwnAccountRead in the Worker stack, which would have failed next.

This restores the released description, so the update is an in-place policy document change again. A test now catches this class of change before release.

Changes

  • infra/lib/own-account-read.ts: the description is back to the v0.8.56 string. A comment says why it is frozen and where the new scope lives (the statements).
  • infra/test/fixtures/released-managed-policies.json (new): Description, ManagedPolicyName and Path of every managed policy in the native release (parent and every child template), keyed by template and logical id, taken from the v0.8.56-beta.20261109 build.
  • infra/test/native.test.ts: a new test fails when any pinned value changes. Its message says the change replaces the policy, fails every install's update with "already exists", and that new wording belongs in a code comment or a statement Sid, not the description. It also fails on a managed policy missing from the fixture, so a new policy is pinned from its first release. Removing a policy is allowed.

Verification

  • Built the native release for tag v0.8.56-beta.20261109 and for this branch with buildNative, then compared every resource present in both. With the fix, the only changed properties are Lambda Environment (Gateway, Worker, Streaming, Updater), CloudFront DistributionConfig, ReleaseAssets Files, and the two own-account policies' PolicyDocument. All of these update in place. Everything else is new (the /mcp, /.well-known and /oauth routes and their permissions). No other replacement-forcing property changed.
  • With the Knowledge: connect a Bedrock knowledge base in place, searched live in your AWS account #526 description put back, the new test fails and names both Api/GatewayOwnAccountRead and Worker/WorkerOwnAccountRead.
  • npm test in infra/: 157 of 157 pass.
  • cfn-lint on every native template: no errors, only the existing W3005 and W2531 warnings.
  • No entry in docs/incidents.md: that file covers worker run regressions (Rust cases), not infra updates.

v0.8.57 changed the Description of the GatewayOwnAccountRead and
WorkerOwnAccountRead managed policies. Description forces a replacement,
the replacement keeps the generated name, and IAM refused the create
("A policy called ... already exists"), so updates from v0.8.56 rolled back.
The released wording is restored; the update is an in-place policy document
change again.

A test now pins Description, ManagedPolicyName and Path of every managed
policy in the native release (test/fixtures/released-managed-policies.json).
@nambok
nambok merged commit b770867 into main Nov 9, 2026
10 checks passed
@nambok
nambok deleted the fix/own-account-read-policy-replacement branch November 9, 2026 15:04
coderhelm Bot pushed a commit that referenced this pull request Dec 3, 2026
Moves dashboardRef from 6593784 to 1002bc7, carrying CoderHelm/coderhelm #502, #514, #513, #527, #530, #531, #533, #529, #536, #535, #499 and #537.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant